import { Component, OnInit, ViewChild } from '@angular/core';
import { ColumnType, SPage, TablePageComponent } from '@shared/components/table-page/table-page.component';
import { NzMessageService, NzModalService } from 'ng-zorro-antd';
import { ApiService } from '@core/services/api';
import {HttpClient} from "@angular/common/http";
import { PermissionService } from '@core/services/permission.service';
import { ACLService } from '@delon/acl';
import { STData } from '@delon/abc';

@Component({
  selector: 'app-accountant-list',
  templateUrl: './accountant-list.component.html',
  styles: []
})
export class AccountantListComponent implements OnInit {
  @ViewChild('st', {static: false})st: TablePageComponent;
  config: SPage = {
    columns: [
      {
        index: 'areaShortName',
        title: '小区',
        filter: {
          index:'name',
          type: 'string'
        }
      },
      {
        index: 'areaName',
        title: '地址',
      },
      {
        index: 'total',
        title: '收入统计(元)',
        statistical: 'sum',
        key: 'total',
      },
    ],
    reqUrl: "/core/qr/pay/getQrStatistics",
  };
  selectedData: object[];
  //数据预处理
  dataProcess(data: STData[]){
    return data;
  }
  _selectChange(e): void {
    this.selectedData = e;
  }

  selectChange(event): void {
    this.st.searchData({areaParentId: event.keys[0]});
  }

 
  constructor(
    private modal: NzModalService,
    private msg: NzMessageService,
    private api: ApiService,
    private http: HttpClient,
    private permission: PermissionService,
    private aclService: ACLService
  ) { }


  ngOnInit() {
  
  }

}
